# encoding: utf-8
Tuho::Application.routes.draw do

  get 'map/index'
  
  match 'map/wms' => 'map#wms', :via => [:get, :post]
  match 'map/wfs' => 'map#wfs', :via => [:get, :post]
  
  match 'users/login', :via => [:get, :post]
  match 'users/logout', :via => :post
  
  resources :locations, :only => :search do
    collection do
      get 'search'
    end
  end

  get 'counties' => 'counties#index'
  get 'counties/:code' => 'counties#show'
  
  get 'greater_areas' => 'greater_areas#index'
  get 'greater_areas/:code' => 'greater_areas#show'
  
  get 'languages' => 'languages#index'
  get 'languages/:code' => 'languages#show'
  
  get 'language_majorities' => 'language_majorities#index'
  get 'language_majorities/:code' => 'language_majorities#show'
  
  get 'language_officialities' => 'language_officialities#index'
  get 'language_officialities/:code' => 'language_officialities#show'
  
  get 'location_types' => 'location_types#index'
  get 'location_types/:code' => 'location_types#show'
  
  get 'location_type_groups' => 'location_type_groups#index'
  get 'location_type_groups/:code' => 'location_type_groups#show'
  
  get 'location_type_subgroups' => 'location_type_subgroups#index'
  get 'location_type_subgroups/:code' => 'location_type_subgroups#show'
  
  get 'municipalities' => 'municipalities#index'
  get 'municipalities/:code' => 'municipalities#show'
  
  get 'provinces' => 'provinces#index'
  get 'provinces/:code' => 'provinces#show'
  
  get 'regions' => 'regions#index'
  get 'regions/:code' => 'regions#show'
  
  get 'scale_relevancies' => 'scale_relevancies#index'
  get 'scale_relevancies/:code' => 'scale_relevancies#show'
  
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => 'map#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end
